<template>
    <el-form status-icon label-width="300px"  class="demo-ruleForm" disabled="true" style="padding-top: 50px;">
        <el-form-item label="当前头像：">
            <pan-thumb width="100px" height="100px" :image="avatar"></pan-thumb>
        </el-form-item>
        <el-form-item label="姓名：">
            {{name}}
        </el-form-item>
        <el-form-item label="性别：">
            {{formatSex(sex)}}
        </el-form-item>
        <el-form-item label="电话：">
            {{phone}}
        </el-form-item>
        <el-form-item label="所属工厂：">
            {{factoryName}}
        </el-form-item>
        <el-form-item label="组别：">
            {{groupName}}
        </el-form-item>
        <el-form-item label="职务：">
            {{dutyName}}
        </el-form-item>
    </el-form>
</template>

<script>
  import { mapGetters } from 'vuex'
  import PanThumb from '@/components/PanThumb'

  export default {
    name: 'UserCenter',
    components: {
      PanThumb
    },
    data() {
      return {
      }
    },
    computed: {
      ...mapGetters([
        'avatar',
        'name',
        'sex',
        'phone',
        'factoryName',
        'groupName',
        'dutyName'
      ])
    },
    methods: {
      formatSex(sex) {
        return (sex === '1') ? '男' : '女'
      }
    }
  }
</script>

<style scoped>
    .el-form-item {
        margin-bottom: 10px;
    }
</style>
